<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">
    <title>role_assign</title>

    <link rel="stylesheet" type="text/css" href="css/edittable.css"  ></link>
    <link rel="stylesheet" type="text/css" href="css/validate.css"  ></link>

	<script type="text/javascript" src="js/jquery-1.8.0.js"></script> 
	<script type="text/javascript">
		$(function(){
			$("input[type=radio]").each(function(){
				if("${admin.roleId}"==this.value){
					this.checked = true;
				}
			});
		});
	</script>

</head>
<body>
	<div class="div_title">
	<div class="div_titlename"><img src="images/san_jiao.gif"><span>角色分配</span></div>
	</div>
	
	<form action="RoleServlet.do" method="post">
		<input type="hidden" name="flag" value="updateAdminRole">
		<input type="hidden" name="id" value="${admin.id }">
		<table class="edit_table">
		    <tr>
		        <td class="td_info">角色账号:</td>
		        <td class="td_input_short">
		            <input type="text" disabled="disabled" class="txtbox" name="adminName" value="${admin.adminName }"/>
		        </td>
		        <td></td>
		    </tr>
		    <tr>
		        <td class="td_info">用户角色:</td>
		        <td>
			        <c:forEach var="role" items="${roleList }">
			        <input type="radio" id="roleId" name="roleId" value="${role.id }">${role.roleName } <br>
			        </c:forEach>
		        </td>
		    </tr>
		    <tr>
		        <td class="td_info"></td>
		        <td>
		            <input class="form_btn" type="submit" value="保存修改" onclick="return confirm('确定修改吗')"/>
		        </td>
		        <td>
		            <label id="result_msg" class="result_msg">${msg}</label>
		        </td>
		    </tr>
		</table>
	</form>
</body>
</html>
